<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="apple-touch-icon" sizes="76x76" href="./assets/img/apple-icon.png">
    <link rel="icon" type="image/png" href="./assets/img/favicon.png">
    <title>GradeSystem </title>

    <link href="./assets/css/css.css" rel="stylesheet">
    <link href="./assets/css/nucleo-icons.css" rel="stylesheet">
    <link href="./assets/css/nucleo-svg.css" rel="stylesheet">
    <script src="assets/js/349ee9c857.js" crossorigin="anonymous"></script>
    <link href="./assets/css/nucleo-svg.css" rel="stylesheet">
    <link id="pagestyle" href="./assets/css/corporate-ui-dashboard.css?v=1.0.0" rel="stylesheet">
</head>

<body class="">
<div class="container position-sticky z-index-sticky top-0">
    <div class="row">
        <div class="col-12">

            <nav class="navbar navbar-expand-lg blur border-radius-sm top-0 z-index-3 shadow position-absolute my-3 py-2 start-0 end-0 mx-4">
                <div class="container-fluid px-1">
                    <a class="navbar-brand font-weight-bolder ms-lg-0 " href="./index.html">
                        GradeSystem </a>
                    <button class="navbar-toggler shadow-none ms-2" type="button" data-bs-toggle="collapse"
                            data-bs-target="#navigation" aria-controls="navigation" aria-expanded="false"
                            aria-label="Toggle navigation">
              <span class="navbar-toggler-icon mt-2">
                <span class="navbar-toggler-bar bar1"></span>
                <span class="navbar-toggler-bar bar2"></span>
                <span class="navbar-toggler-bar bar3"></span>
              </span>
                    </button>
                    <div class="collapse navbar-collapse" id="navigation">
                        <ul class="navbar-nav mx-auto ms-xl-auto">
                            <li class="nav-item">
                                <a class="nav-link d-flex align-items-center me-2 text-dark font-weight-bold"
                                   href="./register.html">
                                    <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"
                                         fill="currentColor" class=" text-dark  me-1">
                                        <path fill-rule="evenodd"
                                              d="M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z"
                                              clip-rule="evenodd"></path>
                                    </svg>
                                    注册
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link d-flex align-items-center me-2 " href="/login">
                                    <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"
                                         fill="currentColor" class="opacity-6 me-1">
                                        <path fill-rule="evenodd"
                                              d="M15.75 1.5a6.75 6.75 0 00-6.651 7.906c.067.39-.032.717-.221.906l-6.5 6.499a3 3 0 00-.878 2.121v2.818c0 .414.336.75.75.75H6a.75.75 0 00.75-.75v-1.5h1.5A.75.75 0 009 19.5V18h1.5a.75.75 0 00.53-.22l2.658-2.658c.19-.189.517-.288.906-.22A6.75 6.75 0 1015.75 1.5zm0 3a.75.75 0 000 1.5A2.25 2.25 0 0118 8.25a.75.75 0 001.5 0 3.75 3.75 0 00-3.75-3.75z"
                                              clip-rule="evenodd"></path>
                                    </svg>
                                    登陆
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
    </div>
</div>
<main class="main-content  mt-0">
    <section>
        <div class="page-header min-vh-100">
            <div class="container">
                <div class="row">
                    <div class="col-md-6">
                        <div class="position-absolute w-40 top-0 start-0 h-100 d-md-block d-none">
                            <div class="oblique-image position-absolute d-flex fixed-top ms-auto h-100 z-index-0 bg-cover me-n8"
                                 style="background-image:url('./assets/img/image-sign-up.jpg')">
                                <div class="my-auto text-start max-width-350 ms-7">
                                    <h1 class="mt-3 text-white font-weight-bolder">开始 <br> 新的用户.</h1>
                                    <p class="text-white text-lg mt-4 mb-4">注册一个新的用户吧~</p>
                                </div>
                                <div class="text-start position-absolute fixed-bottom ms-7">
                                    <h6 class="text-white text-sm mb-5">Copyright © 2024 GradeSystem.</h6>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 d-flex flex-column mx-auto">
                        <div class="card card-plain mt-8">
                            <div class="card-header pb-0 text-left bg-transparent">
                                <h3 class="font-weight-black text-dark display-6">注册</h3>
                                <p class="mb-0">很高兴见到你! 输入你的信息吧.</p>
                            </div>
                            <div class="card-body">
                                <form role="form">
                                    <label>用户名</label>
                                    <div class="mb-3">
                                        <input id="name_inp" type="text" class="form-control" placeholder="用户名">
                                    </div>
                                    <label>密码</label>
                                    <div class="mb-3">
                                        <input id="pwd_inp" type="password" class="form-control" placeholder="密码">
                                    </div>
                                    <div class="text-center">
                                        <button onclick="register_click()" type="button"
                                                class="btn btn-dark w-100 mt-4 mb-3">注册
                                        </button>
                                    </div>
                                </form>
                            </div>
                            <div class="card-footer text-center pt-0 px-lg-2 px-1">
                                <p class="mb-4 text-xs mx-auto">
                                    已有账号？
                                    <a href="/login" class="text-dark font-weight-bold">登陆</a>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<script src="./assets/js/core/popper.min.js"></script>
<script src="./assets/js/core/bootstrap.min.js"></script>
<script src="./assets/js/plugins/perfect-scrollbar.min.js"></script>
<script src="./assets/js/plugins/smooth-scrollbar.min.js"></script>
<script>
    var win = navigator.platform.indexOf('Win') > -1;
    if (win && document.querySelector('#sidenav-scrollbar')) {
        var options = {
            damping: '0.5'
        }
        Scrollbar.init(document.querySelector('#sidenav-scrollbar'), options);
    }
</script>

<script async defer src="./assets/js/buttons.js"></script>

<script src="./assets/js/corporate-ui-dashboard.min.js?v=1.0.0"></script>
</body>
<script src="assets/js/jquery-3.6.0.min.js"></script>
<script src="assets/js/my_tool.js"></script>

<script type="text/javascript">

    function register_click() {
        let name = $("#name_inp").val()
        let pwd = $("#pwd_inp").val()
        if (name === "" || pwd === "") {
            window.alert("内容填写不完整!")
            return;
        }
        $.ajax({
            url: "/aj_register",
            type: 'POST',
            data: {"name": name, "pwd": pwd, "status": 0},
            dataType: 'text',
            success: function (data) {
                data = parseInt(data)
                if (data === -1) {
                    window.alert("注册错误!")
                    return
                }
                if (data === -2) {
                    window.alert("用户名已存在!")
                    return
                }
                window.location = loginPage
            },
            error: function () {
                window.alert("请求错误!")
            }
        });
    }
</script>


</html>